body {
    width: 100vw;
    height: 100vh;
    background-color: #fafafa;
}

@mixin center {
    display: flex;
    justify-content: center;
    align-items: center;
}

$greenblue:#41a8a5;

:root {
    font-size: 15px;
}

hr {
    height: 1px;
    background-color: #ddd;
    border: none;
}

.navbar {
    @include center();
    background-color: #f8f9fa;
    padding: 1rem 0;

    .logo {
        @include center();
        color: $greenblue;

        i.fa {
            font-size: 1.5rem;
            margin-right: .3rem;
        }

        span {
            font-size: 1.5rem;
            margin-right: 1rem;
        }
    }

    &>nav {
        @include center();

        a {
            text-decoration: none;
            color: #7c7c7d;
            font-size: 1.1rem;
            font-weight: 600;
            padding: 0 .5rem;
        }
    }

    &>.member {
        @include center();

        .message {
            cursor: pointer;
            position: relative;
            margin-right: 2rem;

            i.fa {
                font-size: 1.4rem;
                margin-left: 1rem;
            }

            span {
                position: absolute;
                background-color: $greenblue;
                color: white;
                padding: .1rem .3rem;
                border-radius: .2rem;
                font-size: .5rem;
                top: -.5rem;
                right: -.9rem;
            }
        }

        &>.user {
            display: flex;
            cursor: pointer;
            position: relative;

            &>img {
                width: 1.5rem;
                height: 1.5rem;
                margin-right: .5rem;
                border-radius: .3rem;
            }

            &>.name {
                @include center();

                label {
                    cursor: pointer;

                    span {
                        color: #7c7c7d;
                        font-size: 1.1rem;
                        margin-right: .2rem;
                    }

                    i.fa {
                        position: relative;
                        top: -0.2rem;
                    }
                }
            }

            input#toggle-menu:checked~nav {
                display: grid;
            }

            nav {
                display: none;
                position: absolute;
                right: 3rem;
                left: 0;
                background-color: #ffffff;
                top: 2rem;
                border: solid 1px #ddd;
                padding: 1rem 0;

                a {
                    text-decoration: none;
                    font-size: 1.1rem;
                    padding: 0.5rem 1rem;
                    color: #333;
                }
            }
        }
    }

    &>.toggle-icon {
        @include center();
        display: none;
        position: absolute;
        border: solid 1px #ddd;
        width: 2.2rem;
        height: 2.2rem;
        font-size: 1.2rem;
        right: 1rem;
        top: 0.8rem;
        transition-duration: 0.5s;
    }
}

@media (max-width:576px) {
    .navbar {
        justify-content: flex-start;
        align-items: flex-start;
        padding-left: 1rem;
        flex-direction: column;

        &>nav {
            display: none;
            padding-top: 1rem;
            flex-direction: column;

            a {
                margin-bottom: 1rem;
                align-self: flex-start;
            }
        }

        &>.member {
            display: none;
            flex-direction: column;
            align-items: flex-start;
            margin-bottom: 1rem;

            .message {
                margin-left: -.5rem;
            }

            .user {
                margin-top: .5rem;
                left: 1rem;
            }
        }

        .toggle-icon {
            display: flex;
        }

        input#dropdown-menu:checked {
            &~nav {
                display: flex;
            }

            &~.member {
                display: flex;
            }

            &~.toggle-icon {
                transform: rotate(180deg);
            }
        }
    }

}